CentOS7安装GoLang环境及BeeGo框架

您所在的位置:网站首页 beego v2教程 CentOS7安装GoLang环境及BeeGo框架

CentOS7安装GoLang环境及BeeGo框架

2023-04-12 16:40| 来源: 网络整理| 查看: 265

创建第一个beego项目

进入目录/home/zhuzi/go/srccd /home/zhuzi/go/src​利用bee命令创建helloworld项目bee new helloworld

控制台输出以下内容

      create   /home/zhuzi/go/src/helloworld/go.mod       create   /home/zhuzi/go/src/helloworld/       create   /home/zhuzi/go/src/helloworld/conf/       create   /home/zhuzi/go/src/helloworld/controllers/       create   /home/zhuzi/go/src/helloworld/models/       create   /home/zhuzi/go/src/helloworld/routers/       create   /home/zhuzi/go/src/helloworld/tests/       create   /home/zhuzi/go/src/helloworld/static/       create   /home/zhuzi/go/src/helloworld/static/js/       create   /home/zhuzi/go/src/helloworld/static/css/       create   /home/zhuzi/go/src/helloworld/static/img/       create   /home/zhuzi/go/src/helloworld/views/       create   /home/zhuzi/go/src/helloworld/conf/app.conf       create   /home/zhuzi/go/src/helloworld/controllers/default.go       create   /home/zhuzi/go/src/helloworld/views/index.tpl       create   /home/zhuzi/go/src/helloworld/routers/router.go       create   /home/zhuzi/go/src/helloworld/tests/default_test.go       create   /home/zhuzi/go/src/helloworld/main.go2020/10/21 11:44:48 SUCCESS ▶ 0003 New application successfully created!

进入helloworld项目根目录

cd helloworld/

启动helloworld项目

bee run

控制台输出以下内容

______| ___ \| |_/ / ___   ___| ___ \ / _ \ / _ \| |_/ /| __/| __/\____/ \___| \___| v1.11.02020/10/21 11:44:57 INFO     ▶ 0001 Using 'helloworld' as 'appname'2020/10/21 11:44:57 INFO     ▶ 0002 Initializing watcher...go: downloading gopkg.in/yaml.v2 v2.2.1go: finding module for package github.com/shiena/ansicolorgo: downloading github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18go: found github.com/shiena/ansicolor in github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18github.com/astaxie/beego/configgopkg.in/yaml.v2github.com/shiena/ansicolorgithub.com/astaxie/beego/sessiongithub.com/astaxie/beego/logsgithub.com/astaxie/beego/gracegithub.com/astaxie/beego/contextgithub.com/astaxie/beego/toolboxgithub.com/astaxie/beego/context/paramgithub.com/astaxie/beegohelloworld/controllershelloworld/routershelloworld2020/10/21 11:45:10 SUCCESS ▶ 0003 Built Successfully!2020/10/21 11:45:10 INFO     ▶ 0004 Restarting 'helloworld'...2020/10/21 11:45:10 SUCCESS ▶ 0005 './helloworld' is running...2020/10/21 11:45:10.538 [I] [asm_amd64.s:1374] http server Running on http://:8080

到此为止,GoLang环境及Beego框架安装和配置完成



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3